<template>
  <div id="mine-order-detail-owner">
    <fill-owner-info
      v-if="infoReady"
      :gotLicence="gotLicenceOrNot"
      type="part"
      :info="info"
      :editable="false"></fill-owner-info>
  </div>
</template>

<script>
  import FillOwnerInfo from '../comp/comp-fill-owner-info.vue';
  export default {
    name: "mine-order-detail-owner",
    components: {
      FillOwnerInfo
    },
    data() {
      return {
        infoReady: false,
        info: {},
        gotLicenceOrNot: false
      }
    },
    created() {
      this.$http.post({
        api: this.$api.USER_ORDER_DETAIL_SPECIFIC,
        params: {
          car_owner_id: this.$route.params.car_owner_id
        },
        success: (res) => {
          let details = res.data.data;

          this.info = {
            ownerType: details.car_owner_type,

            name: details.name,
            idNum: details.num,
            idEffectTime: details.end_date,
            licence: details.plate_num,
            licenceType: details.plate_num_type,
            tel: details.phone,
            address: details.address,
            contact: details.linkman,
            contactGender: details.sex,
            idFront: details.id_card_face,
            idBack: details.id_card_back
          };

          if (this.info.licence) {
            this.gotLicenceOrNot = true;
          }

          this.infoReady = true;
        }
      });
    }
  }
</script>

<style scoped lang="scss">
  #mine-order-detail-owner {

  }
</style>
